import yamail,logging,HTMLTestRunner_cn

class Tools():
    def log(self):
        log = logging.basicConfig(level=logging.DEBUG,
                                  filemode='a+',
                                  filename=r'E:\gg4\PythonProject1\month_99\log\Aa.log',
                                  format='%(levelname)s-%(asctime)s-%(filename)s-%(message)s-%(lineno)d')
        return log

    def report(self):
        report = HTMLTestRunner_cn.HTMLTestRunner(open(r'E:\gg4\PythonProject1\month_99\report\Aa.html', 'wb'),
                                                  title='A3mall测试业务',
                                                  description='测试通过')
        return report

    def mail(self):
        mail = yamail.SMTP(user='3080172040@qq.com',password='yotehzrzfsvgdeii',host='smtp.qq.com',port=465)
        mail.send(to='3080172040@qq.com',subject="A3mall测试用例",contents=['测试通过',
                                                                            r'E:\gg4\PythonProject1\month_99\log\Aa.log',
                                                                            r'E:\gg4\PythonProject1\month_99\report\Aa.html'])
        mail.close()